import Vue from 'vue'
import Router from 'vue-router'
import login from '@/view/login.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: login
    },
    {
      path: '/home',
      name: 'Home',
      component: () => import('../view/home.vue'),
      children: [
        {
          path: '/user/home',
          name: 'home',
          component: () => import('../view/user/home.vue')
        },
        {
          path: '/user/list',
          name: 'list',
          component: () => import('../view/user/list.vue')
        },
        {
          path: '/product/list',
          name: 'ProductList',
          component: () => import('../view/product/list.vue')
        },
        {
          path: '/addProcuct',
          name: 'addProcuct',
          component: () => import('../view/product/addlist.vue')
        },
        {
          path: '/details',
          name: 'details',
          component: () => import('../view/product/details.vue')
        },
        {
          path: '/edit',
          name: 'edit',
          component: () => import('../view/product/edit.vue')
        },
        {
          path: '/product',
          name: 'product',
          component: () => import('../view/product/product.vue')
        },
        {
          path: '/addproduct',
          name: 'addproduct',
          component: () => import('../view/product/addproduct.vue')
        },
        {
          path: '/order',
          name: 'order',
          component: () => import('../view/order/order.vue')
        },
        {
          path: '/orderLook',
          name: 'orderLook',
          component: () => import('../view/order/orderLook.vue')
        },
      ]
    }
  ]
})
